Enable make test#20
Conversation
Add a top-level `test` target that builds the library and the test programs against it, then runs the GPU-vs-CPU correctness tests for the 4th-order, GRAPE5 (2nd-order) and 6th-order integrators. The target dispatches to the CUDA or OpenCL test Makefile based on the selected BACKEND, and sets LD_LIBRARY_PATH so the freshly built shared libraries are found at runtime. A `build-tests` target is also provided to compile the tests without running them, and `clean` now also cleans the tests directory. Fix two pre-existing bugs in tests/Makefile_ocl that prevented the OpenCL tests from building/running: link against libsapporo2 (not the old libsapporo name) and symlink kernels from src/OpenCL. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This reverts commit b2382a9.
LourensVeen
left a comment
There was a problem hiding this comment.
I'd prefer a couple tweaks, but looks good otherwise. As for OpenCL not working, agreed on letting someone who wants it fix that. It's not clear that OpenCL has a future anyway. Maybe it would be good to make a note of that somewhere, maybe a separate issue, to document that decision?
| } | ||
| fprintf(stderr, "Using platform %d \n", platform_id); | ||
| PlatformID = PlatformIDs[platform_id]; | ||
|
|
There was a problem hiding this comment.
As I recall, you can configure OpenCL to set a preferred device. I think it would be better to just use that. At any rate preferring NVIDIA here doesn't make much sense, because if you have an NVIDIA GPU you'll be using CUDA anyway.
|
|
||
| # Tests | ||
| # Build the test programs against the freshly built libraries and run the | ||
| # GPU-vs-CPU correctness tests for each supported integration order. The |
There was a problem hiding this comment.
They're GPU-vs-CPU performance tests actually, no comparison of results is done.
Perhaps this is covered by issue #5 ? Anyway, I added a comment to that thread. |
This is cherry-picked commit c1292cb (now commit 17fb33e) -
Add 'make test' target to build and run correctness tests-plus commit c1adf9d -
Try to get an NVIDIA GPU if available.make clean; make all; clear; make testworks,i.e.
make clean; make all BACKEND=CUDA; make test BACKEND=CUDAcompletes without error.However,
make clean; make all BACKEND=OpenCL; make test BACKEND=OpenCLyieldswhen run on a cluster node with a NVIDIA RTX A5000 GPU after
module load opencl-nvidia/12.3on a cluster node when it gets to runningtest_gravity_block_ocl.That same command will result in
test_gravity_block_oclrunning "forever" - i.e. until it is killed - at 100% utilisation on a machine with CUDA 13.2 - more specifically ,nvcc --versiongivescuda_13.2.r13.2/compiler.37668154_0- and a NVIDIA RTX 4090 GPU:I have spent some time trying to fix this, but I did not succeed. Since OpenCL is not used often in AMUSE, I propose to merge.